package net.stratusprogramming.school.Game.Screens;

import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

import net.stratusprogramming.school.Game.Framework.Screen;
import net.stratusprogramming.school.Game.Framework.Scene.Group;
import net.stratusprogramming.school.Game.Framework.Scene.Misc.ImageActor;
import net.stratusprogramming.school.Game.Framework.System.Config;
import net.stratusprogramming.school.Game.Framework.System.InstanceMgr;

public class IntroScreen extends Screen {

	private Group root;
	private Image image;

	public IntroScreen() {		
		root = new Group();
		try {
			image = new Image("res/images/hayes.jpg");
		} catch (SlickException e) { }
	}
	
	@Override
	public void update(int delta) {
		root.update(delta);
		
		if(InstanceMgr.input.isKeyPressed(Input.KEY_SPACE)) InstanceMgr.main.setScreen(InstanceMgr.world);
	}

	@Override
	public void render(Graphics g) {
		image.draw((Config.WINDOW_WIDTH-image.getWidth())/2, 0);
		g.drawString("\"Best game of 2014\" - IGN", 240, 350);
		g.drawString("\"I am a fan\" - Mr. Hayes", 245, 375);
	}
	
}
